package com.gitee.shigen.mq.procuder;

import com.gitee.shigen.base.ExchangeName;
import com.gitee.shigen.base.RoutingKeyName;
import com.gitee.shigen.vo.NotifyMsgSendVO;
import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

/**
 * @author shigenfu
 * @date 2023/7/7 4:36 下午
 */
@Slf4j
@Component
public class NotifyMsgProducer {

    @Resource
    private RabbitTemplate rabbitTemplate;

    public void send(NotifyMsgSendVO notifyMsgSendVO) {
        log.debug("客需任务-生产消息【{}】", notifyMsgSendVO);
        this.rabbitTemplate.convertAndSend(ExchangeName.NOTIFY_MSG.name(),
            RoutingKeyName.NOTIFY_MSG.name(), notifyMsgSendVO);
    }
}
